package cn.tedu.oop2;

/**
 * @author ：Dsi
 * @date ：2021/11/8 16:18
 */
public class TestTeacher {
    public static void main(String[] args) {
        Teacher t=new Teacher();
        Teacher t2=new Teacher(777);
        Teacher t3=new Teacher("松江",'男',38,4900);

    }


}
class Teacher{
    private String name;
    private char gender;
    private int age;
    private double salary;
    {
        System.out.println("我是Teacher类的构造代码块");
    }

    public Teacher(){
        {
            System.out.println("我是teacher类的无参构造中的局部代码块");
        }
        System.out.println("无参构造");
    }
    public Teacher(int n){
        System.out.println("含参构造"+n);
    }

    public Teacher(String name, char gender, int age, double salary) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.salary = salary;
        System.out.println("全参构造"+name);
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public char getGender() {
        return gender;
    }
    public void setGender(char gender) {
        this.gender = gender;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public double getSalary() {
        return salary;
    }
    public void setSalary(double salary) {
        this.salary = salary;
    }
}